package com.shop.shoporder.OrderTimingTask;
import com.shop.shoporder.common.UserRequest;
import com.shop.shoporder.service.ExportService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@Component
public class Export {
    @Autowired
    ExportService exportService;
    @Scheduled(cron="0 30 10 ? * *")//每天早上10.30触发导单
//@Scheduled(fixedRate=300000)//5分钟一次
    public void exportExcel() {
        String Ip = UserRequest.getServerIp();
        if (!Ip.contains("172.18.109.46")) {
            System.out.println("本地运行");
        }else {
            System.out.println("导单开始");
            String res= exportService.exportExcel(null,null,1);
            System.out.println("导单结束");
        }
    }
}
